<?php
/**
 * Created by 荣耀电竞.
 * User: 林子彦 <278805354@qq.com>
 * Date: 2018/5/26 0026
 * Time: 15:29
 */
namespace App\Console\Commands;
use Illuminate\Console\Command;

/**
 * swoole websocket 服务操作
 * Class SwooleCommand
 * @package App\Console\Commands
 */
class SwooleCommand extends Command
{
    /**
     * 命令
     * @var string
     */
    protected $signature = 'websocket {action} {--debug}';

    /**
     * 命令说明
     * @var string
     */
    protected $description = 'websocket服务命令';
    /**
     * 执行控制台命令。
     *
     * @return mixed
     */
    public function handle()
    {
        $action = $this->argument('action');
        switch ($action){
            case "start" :  //启动

                break;
            case 'stop':   //停止

                break;
            case 'restart':  //重启

                break;
            default:
                echo "------------欢迎使用swoole------------\n";
                echo "使用命令php artisan websocket 运行参数为:\n";
                echo "start            启动websocket\n";
                echo "stop             停止websocket\n";
                echo "restart          重启websocket\n";
                echo "可选参数:\n";
                echo "--debug          调试模式\n";

        }

    }

}